/**
 * Company : SIANGKLOM.
 * Created By : Chatree Siangklom
 * Created On : Sep 26, 2013  11:32:55 AM 
 * e-Mail : dr_chatree@hotmail.com
 * Mobile Phone : (+66) 087-921-5115
 * Package Name : com.tis.database.services.security.impl
 * File Name : AdUserLoginHistoryServicesImpl.java
 * TODO
 */
package com.tis.database.services.security.impl;

import java.math.BigDecimal;

import org.hibernate.HibernateException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.tis.database.dao.security.AdUserLoginHistoryDao;
import com.tis.database.entitys.security.AdUserLoginHistory;
import com.tis.database.services.security.IAdUserLoginHistoryServices;

/**
 * @author Chatree Siangklom of Administrator
 * Date =Sep 26, 2013 : 11:32:55 AM 
 * CreateBy=Chatree Siangklom
 * TODO
 */
@Service
@Transactional(readOnly=true)
public class AdUserLoginHistoryServicesImpl implements IAdUserLoginHistoryServices {
	
	private static final Logger logging = LoggerFactory.getLogger(AdUserLoginHistoryServicesImpl.class);
	
	@Autowired
	private AdUserLoginHistoryDao adUserLoginHistoryDao;
	
	/** (Javadoc)
	 * @see com.tis.database.services.security.IAdUserLoginHistoryServices#save(com.tis.database.entitys.security.AdUserLoginHistory)
	 * Date =Sep 26, 2013 : 11:35:16 AM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	@Override
	@Transactional(readOnly=false)
	public void save(AdUserLoginHistory e) throws HibernateException {
		adUserLoginHistoryDao.save(e);
		
	}

	/** (Javadoc)
	 * @see com.tis.database.services.security.IAdUserLoginHistoryServices#saveOrUpdate(com.tis.database.entitys.security.AdUserLoginHistory)
	 * Date =Sep 26, 2013 : 11:32:59 AM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	@Override
	@Transactional(readOnly=false)
	public void saveOrUpdate(AdUserLoginHistory e) throws HibernateException {
		adUserLoginHistoryDao.saveOrUpdate(e);
		
	}

	/** (Javadoc)
	 * @see com.tis.database.services.security.IAdUserLoginHistoryServices#delete(com.tis.database.entitys.security.AdUserLoginHistory)
	 * Date =Sep 26, 2013 : 11:32:59 AM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	@Override
	@Transactional(readOnly=false)
	public void delete(AdUserLoginHistory e) throws HibernateException {
		adUserLoginHistoryDao.delete(e);
		
	}

	/** (Javadoc)
	 * @see com.tis.database.services.security.IAdUserLoginHistoryServices#NextSequence(java.lang.String)
	 * Date =Sep 26, 2013 : 11:32:59 AM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	@Override	
	@Transactional(readOnly=false)
	synchronized
	public BigDecimal NextSequence(String name) throws HibernateException, Exception {
		return adUserLoginHistoryDao.NextSequence(name);
	}

	/** (Javadoc)
	 * @see com.tis.database.services.security.IAdUserLoginHistoryServices#NextSequence()
	 * Date =Oct 16, 2013 : 4:14:42 PM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	@Override
	@Transactional(readOnly=false)
	synchronized
	public BigDecimal NextSequence() throws HibernateException, Exception {
		return adUserLoginHistoryDao.NextSequence("AD_USER_LOGIN_HISTORY_INSTANCE");
	}
}
